(0) Obligation:

The Runtime Complexity (innermost) of the given CpxTRS could be proven to be BOUNDS(1, n^1).


The TRS R consists of the following rules:

nonZero(0) → false
nonZero(s(x)) → true
p(0) → 0
p(s(x)) → x
id_inc(x) → x
id_inc(x) → s(x)
random(x) → rand(x, 0)
rand(x, y) → if(nonZero(x), x, y)
if(false, x, y) → y
if(true, x, y) → rand(p(x), id_inc(y))

Rewrite Strategy: INNERMOST

(1) TrsToWeightedTrsProof (BOTH BOUNDS(ID, ID) transformation)

Transformed TRS to weighted TRS

(2) Obligation:

The Runtime Complexity (innermost) of the given CpxWeightedTrs could be proven to be BOUNDS(1, n^1).


The TRS R consists of the following rules:

nonZero(0) → false [1]
nonZero(s(x)) → true [1]
p(0) → 0 [1]
p(s(x)) → x [1]
id_inc(x) → x [1]
id_inc(x) → s(x) [1]
random(x) → rand(x, 0) [1]
rand(x, y) → if(nonZero(x), x, y) [1]
if(false, x, y) → y [1]
if(true, x, y) → rand(p(x), id_inc(y)) [1]

Rewrite Strategy: INNERMOST

(3) TypeInferenceProof (BOTH BOUNDS(ID, ID) transformation)

Infered types.

(4) Obligation:

Runtime Complexity Weighted TRS with Types.
The TRS R consists of the following rules:

nonZero(0) → false [1]
nonZero(s(x)) → true [1]
p(0) → 0 [1]
p(s(x)) → x [1]
id_inc(x) → x [1]
id_inc(x) → s(x) [1]
random(x) → rand(x, 0) [1]
rand(x, y) → if(nonZero(x), x, y) [1]
if(false, x, y) → y [1]
if(true, x, y) → rand(p(x), id_inc(y)) [1]

The TRS has the following type information:
nonZero :: 0:s → false:true
0 :: 0:s
false :: false:true
s :: 0:s → 0:s
true :: false:true
p :: 0:s → 0:s
id_inc :: 0:s → 0:s
random :: 0:s → 0:s
rand :: 0:s → 0:s → 0:s
if :: false:true → 0:s → 0:s → 0:s

Rewrite Strategy: INNERMOST

(5) CompletionProof (UPPER BOUND(ID) transformation)

The transformation into a RNTS is sound, since:

(a) The obligation is a constructor system where every type has a constant constructor,

(b) The following defined symbols do not have to be completely defined, as they can never occur inside other defined symbols:


random
rand
if

(c) The following functions are completely defined:

p
id_inc
nonZero

Due to the following rules being added:
none

And the following fresh constants: none

(6) Obligation:

Runtime Complexity Weighted TRS where critical functions are completely defined. The underlying TRS is:

Runtime Complexity Weighted TRS with Types.
The TRS R consists of the following rules:

nonZero(0) → false [1]
nonZero(s(x)) → true [1]
p(0) → 0 [1]
p(s(x)) → x [1]
id_inc(x) → x [1]
id_inc(x) → s(x) [1]
random(x) → rand(x, 0) [1]
rand(x, y) → if(nonZero(x), x, y) [1]
if(false, x, y) → y [1]
if(true, x, y) → rand(p(x), id_inc(y)) [1]

The TRS has the following type information:
nonZero :: 0:s → false:true
0 :: 0:s
false :: false:true
s :: 0:s → 0:s
true :: false:true
p :: 0:s → 0:s
id_inc :: 0:s → 0:s
random :: 0:s → 0:s
rand :: 0:s → 0:s → 0:s
if :: false:true → 0:s → 0:s → 0:s

Rewrite Strategy: INNERMOST

(7) NarrowingProof (BOTH BOUNDS(ID, ID) transformation)

Narrowed the inner basic terms of all right-hand sides by a single narrowing step.

(8) Obligation:

Runtime Complexity Weighted TRS where critical functions are completely defined. The underlying TRS is:

Runtime Complexity Weighted TRS with Types.
The TRS R consists of the following rules:

nonZero(0) → false [1]
nonZero(s(x)) → true [1]
p(0) → 0 [1]
p(s(x)) → x [1]
id_inc(x) → x [1]
id_inc(x) → s(x) [1]
random(x) → rand(x, 0) [1]
rand(0, y) → if(false, 0, y) [2]
rand(s(x'), y) → if(true, s(x'), y) [2]
if(false, x, y) → y [1]
if(true, 0, y) → rand(0, y) [3]
if(true, 0, y) → rand(0, s(y)) [3]
if(true, s(x''), y) → rand(x'', y) [3]
if(true, s(x''), y) → rand(x'', s(y)) [3]

The TRS has the following type information:
nonZero :: 0:s → false:true
0 :: 0:s
false :: false:true
s :: 0:s → 0:s
true :: false:true
p :: 0:s → 0:s
id_inc :: 0:s → 0:s
random :: 0:s → 0:s
rand :: 0:s → 0:s → 0:s
if :: false:true → 0:s → 0:s → 0:s

Rewrite Strategy: INNERMOST

(9) CpxTypedWeightedTrsToRntsProof (UPPER BOUND(ID) transformation)

Transformed the TRS into an over-approximating RNTS by (improved) Size Abstraction.
The constant constructors are abstracted as follows:

0 => 0
false => 0
true => 1

(10) Obligation:

Complexity RNTS consisting of the following rules:

id_inc(z) -{ 1 }→ x :|: x >= 0, z = x
id_inc(z) -{ 1 }→ 1 + x :|: x >= 0, z = x
if(z, z', z'') -{ 1 }→ y :|: z' = x, z'' = y, x >= 0, y >= 0, z = 0
if(z, z', z'') -{ 3 }→ rand(x'', y) :|: z' = 1 + x'', z'' = y, z = 1, y >= 0, x'' >= 0
if(z, z', z'') -{ 3 }→ rand(x'', 1 + y) :|: z' = 1 + x'', z'' = y, z = 1, y >= 0, x'' >= 0
if(z, z', z'') -{ 3 }→ rand(0, y) :|: z'' = y, z = 1, y >= 0, z' = 0
if(z, z', z'') -{ 3 }→ rand(0, 1 + y) :|: z'' = y, z = 1, y >= 0, z' = 0
nonZero(z) -{ 1 }→ 1 :|: x >= 0, z = 1 + x
nonZero(z) -{ 1 }→ 0 :|: z = 0
p(z) -{ 1 }→ x :|: x >= 0, z = 1 + x
p(z) -{ 1 }→ 0 :|: z = 0
rand(z, z') -{ 2 }→ if(1, 1 + x', y) :|: z = 1 + x', x' >= 0, y >= 0, z' = y
rand(z, z') -{ 2 }→ if(0, 0, y) :|: y >= 0, z = 0, z' = y
random(z) -{ 1 }→ rand(x, 0) :|: x >= 0, z = x

(11) SimplificationProof (BOTH BOUNDS(ID, ID) transformation)

Simplified the RNTS by moving equalities from the constraints into the right-hand sides.

(12) Obligation:

Complexity RNTS consisting of the following rules:

id_inc(z) -{ 1 }→ z :|: z >= 0
id_inc(z) -{ 1 }→ 1 + z :|: z >= 0
if(z, z', z'') -{ 1 }→ z'' :|: z' >= 0, z'' >= 0, z = 0
if(z, z', z'') -{ 3 }→ rand(0, z'') :|: z = 1, z'' >= 0, z' = 0
if(z, z', z'') -{ 3 }→ rand(0, 1 + z'') :|: z = 1, z'' >= 0, z' = 0
if(z, z', z'') -{ 3 }→ rand(z' - 1, z'') :|: z = 1, z'' >= 0, z' - 1 >= 0
if(z, z', z'') -{ 3 }→ rand(z' - 1, 1 + z'') :|: z = 1, z'' >= 0, z' - 1 >= 0
nonZero(z) -{ 1 }→ 1 :|: z - 1 >= 0
nonZero(z) -{ 1 }→ 0 :|: z = 0
p(z) -{ 1 }→ 0 :|: z = 0
p(z) -{ 1 }→ z - 1 :|: z - 1 >= 0
rand(z, z') -{ 2 }→ if(1, 1 + (z - 1), z') :|: z - 1 >= 0, z' >= 0
rand(z, z') -{ 2 }→ if(0, 0, z') :|: z' >= 0, z = 0
random(z) -{ 1 }→ rand(z, 0) :|: z >= 0

(13) CpxRntsAnalysisOrderProof (BOTH BOUNDS(ID, ID) transformation)

Found the following analysis order by SCC decomposition:

{ if, rand }
{ nonZero }
{ id_inc }
{ p }
{ random }

(14) Obligation:

Complexity RNTS consisting of the following rules:

id_inc(z) -{ 1 }→ z :|: z >= 0
id_inc(z) -{ 1 }→ 1 + z :|: z >= 0
if(z, z', z'') -{ 1 }→ z'' :|: z' >= 0, z'' >= 0, z = 0
if(z, z', z'') -{ 3 }→ rand(0, z'') :|: z = 1, z'' >= 0, z' = 0
if(z, z', z'') -{ 3 }→ rand(0, 1 + z'') :|: z = 1, z'' >= 0, z' = 0
if(z, z', z'') -{ 3 }→ rand(z' - 1, z'') :|: z = 1, z'' >= 0, z' - 1 >= 0
if(z, z', z'') -{ 3 }→ rand(z' - 1, 1 + z'') :|: z = 1, z'' >= 0, z' - 1 >= 0
nonZero(z) -{ 1 }→ 1 :|: z - 1 >= 0
nonZero(z) -{ 1 }→ 0 :|: z = 0
p(z) -{ 1 }→ 0 :|: z = 0
p(z) -{ 1 }→ z - 1 :|: z - 1 >= 0
rand(z, z') -{ 2 }→ if(1, 1 + (z - 1), z') :|: z - 1 >= 0, z' >= 0
rand(z, z') -{ 2 }→ if(0, 0, z') :|: z' >= 0, z = 0
random(z) -{ 1 }→ rand(z, 0) :|: z >= 0

Function symbols to be analyzed: {if,rand}, {nonZero}, {id_inc}, {p}, {random}

(15) IntTrsBoundProof (UPPER BOUND(ID) transformation)


Computed SIZE bound using CoFloCo for: if
after applying outer abstraction to obtain an ITS,
resulting in: O(n1) with polynomial bound: 1 + z' + z''

Computed SIZE bound using CoFloCo for: rand
after applying outer abstraction to obtain an ITS,
resulting in: O(n1) with polynomial bound: 1 + z + z'

(16) Obligation:

Complexity RNTS consisting of the following rules:

id_inc(z) -{ 1 }→ z :|: z >= 0
id_inc(z) -{ 1 }→ 1 + z :|: z >= 0
if(z, z', z'') -{ 1 }→ z'' :|: z' >= 0, z'' >= 0, z = 0
if(z, z', z'') -{ 3 }→ rand(0, z'') :|: z = 1, z'' >= 0, z' = 0
if(z, z', z'') -{ 3 }→ rand(0, 1 + z'') :|: z = 1, z'' >= 0, z' = 0
if(z, z', z'') -{ 3 }→ rand(z' - 1, z'') :|: z = 1, z'' >= 0, z' - 1 >= 0
if(z, z', z'') -{ 3 }→ rand(z' - 1, 1 + z'') :|: z = 1, z'' >= 0, z' - 1 >= 0
nonZero(z) -{ 1 }→ 1 :|: z - 1 >= 0
nonZero(z) -{ 1 }→ 0 :|: z = 0
p(z) -{ 1 }→ 0 :|: z = 0
p(z) -{ 1 }→ z - 1 :|: z - 1 >= 0
rand(z, z') -{ 2 }→ if(1, 1 + (z - 1), z') :|: z - 1 >= 0, z' >= 0
rand(z, z') -{ 2 }→ if(0, 0, z') :|: z' >= 0, z = 0
random(z) -{ 1 }→ rand(z, 0) :|: z >= 0

Function symbols to be analyzed: {if,rand}, {nonZero}, {id_inc}, {p}, {random}
Previous analysis results are:
if: runtime: ?, size: O(n1) [1 + z' + z'']
rand: runtime: ?, size: O(n1) [1 + z + z']

(17) IntTrsBoundProof (UPPER BOUND(ID) transformation)


Computed RUNTIME bound using CoFloCo for: if
after applying outer abstraction to obtain an ITS,
resulting in: O(n1) with polynomial bound: 11 + 5·z'

Computed RUNTIME bound using CoFloCo for: rand
after applying outer abstraction to obtain an ITS,
resulting in: O(n1) with polynomial bound: 13 + 5·z

(18) Obligation:

Complexity RNTS consisting of the following rules:

id_inc(z) -{ 1 }→ z :|: z >= 0
id_inc(z) -{ 1 }→ 1 + z :|: z >= 0
if(z, z', z'') -{ 1 }→ z'' :|: z' >= 0, z'' >= 0, z = 0
if(z, z', z'') -{ 3 }→ rand(0, z'') :|: z = 1, z'' >= 0, z' = 0
if(z, z', z'') -{ 3 }→ rand(0, 1 + z'') :|: z = 1, z'' >= 0, z' = 0
if(z, z', z'') -{ 3 }→ rand(z' - 1, z'') :|: z = 1, z'' >= 0, z' - 1 >= 0
if(z, z', z'') -{ 3 }→ rand(z' - 1, 1 + z'') :|: z = 1, z'' >= 0, z' - 1 >= 0
nonZero(z) -{ 1 }→ 1 :|: z - 1 >= 0
nonZero(z) -{ 1 }→ 0 :|: z = 0
p(z) -{ 1 }→ 0 :|: z = 0
p(z) -{ 1 }→ z - 1 :|: z - 1 >= 0
rand(z, z') -{ 2 }→ if(1, 1 + (z - 1), z') :|: z - 1 >= 0, z' >= 0
rand(z, z') -{ 2 }→ if(0, 0, z') :|: z' >= 0, z = 0
random(z) -{ 1 }→ rand(z, 0) :|: z >= 0

Function symbols to be analyzed: {nonZero}, {id_inc}, {p}, {random}
Previous analysis results are:
if: runtime: O(n1) [11 + 5·z'], size: O(n1) [1 + z' + z'']
rand: runtime: O(n1) [13 + 5·z], size: O(n1) [1 + z + z']

(19) ResultPropagationProof (UPPER BOUND(ID) transformation)

Applied inner abstraction using the recently inferred runtime/size bounds where possible.

(20) Obligation:

Complexity RNTS consisting of the following rules:

id_inc(z) -{ 1 }→ z :|: z >= 0
id_inc(z) -{ 1 }→ 1 + z :|: z >= 0
if(z, z', z'') -{ 16 }→ s1 :|: s1 >= 0, s1 <= 1 * 0 + 1 * z'' + 1, z = 1, z'' >= 0, z' = 0
if(z, z', z'') -{ 16 }→ s2 :|: s2 >= 0, s2 <= 1 * 0 + 1 * (1 + z'') + 1, z = 1, z'' >= 0, z' = 0
if(z, z', z'') -{ 11 + 5·z' }→ s3 :|: s3 >= 0, s3 <= 1 * (z' - 1) + 1 * z'' + 1, z = 1, z'' >= 0, z' - 1 >= 0
if(z, z', z'') -{ 11 + 5·z' }→ s4 :|: s4 >= 0, s4 <= 1 * (z' - 1) + 1 * (1 + z'') + 1, z = 1, z'' >= 0, z' - 1 >= 0
if(z, z', z'') -{ 1 }→ z'' :|: z' >= 0, z'' >= 0, z = 0
nonZero(z) -{ 1 }→ 1 :|: z - 1 >= 0
nonZero(z) -{ 1 }→ 0 :|: z = 0
p(z) -{ 1 }→ 0 :|: z = 0
p(z) -{ 1 }→ z - 1 :|: z - 1 >= 0
rand(z, z') -{ 13 }→ s' :|: s' >= 0, s' <= 1 * z' + 1 + 1 * 0, z' >= 0, z = 0
rand(z, z') -{ 13 + 5·z }→ s'' :|: s'' >= 0, s'' <= 1 * z' + 1 + 1 * (1 + (z - 1)), z - 1 >= 0, z' >= 0
random(z) -{ 14 + 5·z }→ s :|: s >= 0, s <= 1 * z + 1 * 0 + 1, z >= 0

Function symbols to be analyzed: {nonZero}, {id_inc}, {p}, {random}
Previous analysis results are:
if: runtime: O(n1) [11 + 5·z'], size: O(n1) [1 + z' + z'']
rand: runtime: O(n1) [13 + 5·z], size: O(n1) [1 + z + z']

(21) IntTrsBoundProof (UPPER BOUND(ID) transformation)


Computed SIZE bound using CoFloCo for: nonZero
after applying outer abstraction to obtain an ITS,
resulting in: O(1) with polynomial bound: 1

(22) Obligation:

Complexity RNTS consisting of the following rules:

id_inc(z) -{ 1 }→ z :|: z >= 0
id_inc(z) -{ 1 }→ 1 + z :|: z >= 0
if(z, z', z'') -{ 16 }→ s1 :|: s1 >= 0, s1 <= 1 * 0 + 1 * z'' + 1, z = 1, z'' >= 0, z' = 0
if(z, z', z'') -{ 16 }→ s2 :|: s2 >= 0, s2 <= 1 * 0 + 1 * (1 + z'') + 1, z = 1, z'' >= 0, z' = 0
if(z, z', z'') -{ 11 + 5·z' }→ s3 :|: s3 >= 0, s3 <= 1 * (z' - 1) + 1 * z'' + 1, z = 1, z'' >= 0, z' - 1 >= 0
if(z, z', z'') -{ 11 + 5·z' }→ s4 :|: s4 >= 0, s4 <= 1 * (z' - 1) + 1 * (1 + z'') + 1, z = 1, z'' >= 0, z' - 1 >= 0
if(z, z', z'') -{ 1 }→ z'' :|: z' >= 0, z'' >= 0, z = 0
nonZero(z) -{ 1 }→ 1 :|: z - 1 >= 0
nonZero(z) -{ 1 }→ 0 :|: z = 0
p(z) -{ 1 }→ 0 :|: z = 0
p(z) -{ 1 }→ z - 1 :|: z - 1 >= 0
rand(z, z') -{ 13 }→ s' :|: s' >= 0, s' <= 1 * z' + 1 + 1 * 0, z' >= 0, z = 0
rand(z, z') -{ 13 + 5·z }→ s'' :|: s'' >= 0, s'' <= 1 * z' + 1 + 1 * (1 + (z - 1)), z - 1 >= 0, z' >= 0
random(z) -{ 14 + 5·z }→ s :|: s >= 0, s <= 1 * z + 1 * 0 + 1, z >= 0

Function symbols to be analyzed: {nonZero}, {id_inc}, {p}, {random}
Previous analysis results are:
if: runtime: O(n1) [11 + 5·z'], size: O(n1) [1 + z' + z'']
rand: runtime: O(n1) [13 + 5·z], size: O(n1) [1 + z + z']
nonZero: runtime: ?, size: O(1) [1]

(23) IntTrsBoundProof (UPPER BOUND(ID) transformation)


Computed RUNTIME bound using CoFloCo for: nonZero
after applying outer abstraction to obtain an ITS,
resulting in: O(1) with polynomial bound: 1

(24) Obligation:

Complexity RNTS consisting of the following rules:

id_inc(z) -{ 1 }→ z :|: z >= 0
id_inc(z) -{ 1 }→ 1 + z :|: z >= 0
if(z, z', z'') -{ 16 }→ s1 :|: s1 >= 0, s1 <= 1 * 0 + 1 * z'' + 1, z = 1, z'' >= 0, z' = 0
if(z, z', z'') -{ 16 }→ s2 :|: s2 >= 0, s2 <= 1 * 0 + 1 * (1 + z'') + 1, z = 1, z'' >= 0, z' = 0
if(z, z', z'') -{ 11 + 5·z' }→ s3 :|: s3 >= 0, s3 <= 1 * (z' - 1) + 1 * z'' + 1, z = 1, z'' >= 0, z' - 1 >= 0
if(z, z', z'') -{ 11 + 5·z' }→ s4 :|: s4 >= 0, s4 <= 1 * (z' - 1) + 1 * (1 + z'') + 1, z = 1, z'' >= 0, z' - 1 >= 0
if(z, z', z'') -{ 1 }→ z'' :|: z' >= 0, z'' >= 0, z = 0
nonZero(z) -{ 1 }→ 1 :|: z - 1 >= 0
nonZero(z) -{ 1 }→ 0 :|: z = 0
p(z) -{ 1 }→ 0 :|: z = 0
p(z) -{ 1 }→ z - 1 :|: z - 1 >= 0
rand(z, z') -{ 13 }→ s' :|: s' >= 0, s' <= 1 * z' + 1 + 1 * 0, z' >= 0, z = 0
rand(z, z') -{ 13 + 5·z }→ s'' :|: s'' >= 0, s'' <= 1 * z' + 1 + 1 * (1 + (z - 1)), z - 1 >= 0, z' >= 0
random(z) -{ 14 + 5·z }→ s :|: s >= 0, s <= 1 * z + 1 * 0 + 1, z >= 0

Function symbols to be analyzed: {id_inc}, {p}, {random}
Previous analysis results are:
if: runtime: O(n1) [11 + 5·z'], size: O(n1) [1 + z' + z'']
rand: runtime: O(n1) [13 + 5·z], size: O(n1) [1 + z + z']
nonZero: runtime: O(1) [1], size: O(1) [1]

(25) ResultPropagationProof (UPPER BOUND(ID) transformation)

Applied inner abstraction using the recently inferred runtime/size bounds where possible.

(26) Obligation:

Complexity RNTS consisting of the following rules:

id_inc(z) -{ 1 }→ z :|: z >= 0
id_inc(z) -{ 1 }→ 1 + z :|: z >= 0
if(z, z', z'') -{ 16 }→ s1 :|: s1 >= 0, s1 <= 1 * 0 + 1 * z'' + 1, z = 1, z'' >= 0, z' = 0
if(z, z', z'') -{ 16 }→ s2 :|: s2 >= 0, s2 <= 1 * 0 + 1 * (1 + z'') + 1, z = 1, z'' >= 0, z' = 0
if(z, z', z'') -{ 11 + 5·z' }→ s3 :|: s3 >= 0, s3 <= 1 * (z' - 1) + 1 * z'' + 1, z = 1, z'' >= 0, z' - 1 >= 0
if(z, z', z'') -{ 11 + 5·z' }→ s4 :|: s4 >= 0, s4 <= 1 * (z' - 1) + 1 * (1 + z'') + 1, z = 1, z'' >= 0, z' - 1 >= 0
if(z, z', z'') -{ 1 }→ z'' :|: z' >= 0, z'' >= 0, z = 0
nonZero(z) -{ 1 }→ 1 :|: z - 1 >= 0
nonZero(z) -{ 1 }→ 0 :|: z = 0
p(z) -{ 1 }→ 0 :|: z = 0
p(z) -{ 1 }→ z - 1 :|: z - 1 >= 0
rand(z, z') -{ 13 }→ s' :|: s' >= 0, s' <= 1 * z' + 1 + 1 * 0, z' >= 0, z = 0
rand(z, z') -{ 13 + 5·z }→ s'' :|: s'' >= 0, s'' <= 1 * z' + 1 + 1 * (1 + (z - 1)), z - 1 >= 0, z' >= 0
random(z) -{ 14 + 5·z }→ s :|: s >= 0, s <= 1 * z + 1 * 0 + 1, z >= 0

Function symbols to be analyzed: {id_inc}, {p}, {random}
Previous analysis results are:
if: runtime: O(n1) [11 + 5·z'], size: O(n1) [1 + z' + z'']
rand: runtime: O(n1) [13 + 5·z], size: O(n1) [1 + z + z']
nonZero: runtime: O(1) [1], size: O(1) [1]

(27) IntTrsBoundProof (UPPER BOUND(ID) transformation)


Computed SIZE bound using CoFloCo for: id_inc
after applying outer abstraction to obtain an ITS,
resulting in: O(n1) with polynomial bound: 1 + z

(28) Obligation:

Complexity RNTS consisting of the following rules:

id_inc(z) -{ 1 }→ z :|: z >= 0
id_inc(z) -{ 1 }→ 1 + z :|: z >= 0
if(z, z', z'') -{ 16 }→ s1 :|: s1 >= 0, s1 <= 1 * 0 + 1 * z'' + 1, z = 1, z'' >= 0, z' = 0
if(z, z', z'') -{ 16 }→ s2 :|: s2 >= 0, s2 <= 1 * 0 + 1 * (1 + z'') + 1, z = 1, z'' >= 0, z' = 0
if(z, z', z'') -{ 11 + 5·z' }→ s3 :|: s3 >= 0, s3 <= 1 * (z' - 1) + 1 * z'' + 1, z = 1, z'' >= 0, z' - 1 >= 0
if(z, z', z'') -{ 11 + 5·z' }→ s4 :|: s4 >= 0, s4 <= 1 * (z' - 1) + 1 * (1 + z'') + 1, z = 1, z'' >= 0, z' - 1 >= 0
if(z, z', z'') -{ 1 }→ z'' :|: z' >= 0, z'' >= 0, z = 0
nonZero(z) -{ 1 }→ 1 :|: z - 1 >= 0
nonZero(z) -{ 1 }→ 0 :|: z = 0
p(z) -{ 1 }→ 0 :|: z = 0
p(z) -{ 1 }→ z - 1 :|: z - 1 >= 0
rand(z, z') -{ 13 }→ s' :|: s' >= 0, s' <= 1 * z' + 1 + 1 * 0, z' >= 0, z = 0
rand(z, z') -{ 13 + 5·z }→ s'' :|: s'' >= 0, s'' <= 1 * z' + 1 + 1 * (1 + (z - 1)), z - 1 >= 0, z' >= 0
random(z) -{ 14 + 5·z }→ s :|: s >= 0, s <= 1 * z + 1 * 0 + 1, z >= 0

Function symbols to be analyzed: {id_inc}, {p}, {random}
Previous analysis results are:
if: runtime: O(n1) [11 + 5·z'], size: O(n1) [1 + z' + z'']
rand: runtime: O(n1) [13 + 5·z], size: O(n1) [1 + z + z']
nonZero: runtime: O(1) [1], size: O(1) [1]
id_inc: runtime: ?, size: O(n1) [1 + z]

(29) IntTrsBoundProof (UPPER BOUND(ID) transformation)


Computed RUNTIME bound using CoFloCo for: id_inc
after applying outer abstraction to obtain an ITS,
resulting in: O(1) with polynomial bound: 1

(30) Obligation:

Complexity RNTS consisting of the following rules:

id_inc(z) -{ 1 }→ z :|: z >= 0
id_inc(z) -{ 1 }→ 1 + z :|: z >= 0
if(z, z', z'') -{ 16 }→ s1 :|: s1 >= 0, s1 <= 1 * 0 + 1 * z'' + 1, z = 1, z'' >= 0, z' = 0
if(z, z', z'') -{ 16 }→ s2 :|: s2 >= 0, s2 <= 1 * 0 + 1 * (1 + z'') + 1, z = 1, z'' >= 0, z' = 0
if(z, z', z'') -{ 11 + 5·z' }→ s3 :|: s3 >= 0, s3 <= 1 * (z' - 1) + 1 * z'' + 1, z = 1, z'' >= 0, z' - 1 >= 0
if(z, z', z'') -{ 11 + 5·z' }→ s4 :|: s4 >= 0, s4 <= 1 * (z' - 1) + 1 * (1 + z'') + 1, z = 1, z'' >= 0, z' - 1 >= 0
if(z, z', z'') -{ 1 }→ z'' :|: z' >= 0, z'' >= 0, z = 0
nonZero(z) -{ 1 }→ 1 :|: z - 1 >= 0
nonZero(z) -{ 1 }→ 0 :|: z = 0
p(z) -{ 1 }→ 0 :|: z = 0
p(z) -{ 1 }→ z - 1 :|: z - 1 >= 0
rand(z, z') -{ 13 }→ s' :|: s' >= 0, s' <= 1 * z' + 1 + 1 * 0, z' >= 0, z = 0
rand(z, z') -{ 13 + 5·z }→ s'' :|: s'' >= 0, s'' <= 1 * z' + 1 + 1 * (1 + (z - 1)), z - 1 >= 0, z' >= 0
random(z) -{ 14 + 5·z }→ s :|: s >= 0, s <= 1 * z + 1 * 0 + 1, z >= 0

Function symbols to be analyzed: {p}, {random}
Previous analysis results are:
if: runtime: O(n1) [11 + 5·z'], size: O(n1) [1 + z' + z'']
rand: runtime: O(n1) [13 + 5·z], size: O(n1) [1 + z + z']
nonZero: runtime: O(1) [1], size: O(1) [1]
id_inc: runtime: O(1) [1], size: O(n1) [1 + z]

(31) ResultPropagationProof (UPPER BOUND(ID) transformation)

Applied inner abstraction using the recently inferred runtime/size bounds where possible.

(32) Obligation:

Complexity RNTS consisting of the following rules:

id_inc(z) -{ 1 }→ z :|: z >= 0
id_inc(z) -{ 1 }→ 1 + z :|: z >= 0
if(z, z', z'') -{ 16 }→ s1 :|: s1 >= 0, s1 <= 1 * 0 + 1 * z'' + 1, z = 1, z'' >= 0, z' = 0
if(z, z', z'') -{ 16 }→ s2 :|: s2 >= 0, s2 <= 1 * 0 + 1 * (1 + z'') + 1, z = 1, z'' >= 0, z' = 0
if(z, z', z'') -{ 11 + 5·z' }→ s3 :|: s3 >= 0, s3 <= 1 * (z' - 1) + 1 * z'' + 1, z = 1, z'' >= 0, z' - 1 >= 0
if(z, z', z'') -{ 11 + 5·z' }→ s4 :|: s4 >= 0, s4 <= 1 * (z' - 1) + 1 * (1 + z'') + 1, z = 1, z'' >= 0, z' - 1 >= 0
if(z, z', z'') -{ 1 }→ z'' :|: z' >= 0, z'' >= 0, z = 0
nonZero(z) -{ 1 }→ 1 :|: z - 1 >= 0
nonZero(z) -{ 1 }→ 0 :|: z = 0
p(z) -{ 1 }→ 0 :|: z = 0
p(z) -{ 1 }→ z - 1 :|: z - 1 >= 0
rand(z, z') -{ 13 }→ s' :|: s' >= 0, s' <= 1 * z' + 1 + 1 * 0, z' >= 0, z = 0
rand(z, z') -{ 13 + 5·z }→ s'' :|: s'' >= 0, s'' <= 1 * z' + 1 + 1 * (1 + (z - 1)), z - 1 >= 0, z' >= 0
random(z) -{ 14 + 5·z }→ s :|: s >= 0, s <= 1 * z + 1 * 0 + 1, z >= 0

Function symbols to be analyzed: {p}, {random}
Previous analysis results are:
if: runtime: O(n1) [11 + 5·z'], size: O(n1) [1 + z' + z'']
rand: runtime: O(n1) [13 + 5·z], size: O(n1) [1 + z + z']
nonZero: runtime: O(1) [1], size: O(1) [1]
id_inc: runtime: O(1) [1], size: O(n1) [1 + z]

(33) IntTrsBoundProof (UPPER BOUND(ID) transformation)


Computed SIZE bound using KoAT for: p
after applying outer abstraction to obtain an ITS,
resulting in: O(n1) with polynomial bound: z

(34) Obligation:

Complexity RNTS consisting of the following rules:

id_inc(z) -{ 1 }→ z :|: z >= 0
id_inc(z) -{ 1 }→ 1 + z :|: z >= 0
if(z, z', z'') -{ 16 }→ s1 :|: s1 >= 0, s1 <= 1 * 0 + 1 * z'' + 1, z = 1, z'' >= 0, z' = 0
if(z, z', z'') -{ 16 }→ s2 :|: s2 >= 0, s2 <= 1 * 0 + 1 * (1 + z'') + 1, z = 1, z'' >= 0, z' = 0
if(z, z', z'') -{ 11 + 5·z' }→ s3 :|: s3 >= 0, s3 <= 1 * (z' - 1) + 1 * z'' + 1, z = 1, z'' >= 0, z' - 1 >= 0
if(z, z', z'') -{ 11 + 5·z' }→ s4 :|: s4 >= 0, s4 <= 1 * (z' - 1) + 1 * (1 + z'') + 1, z = 1, z'' >= 0, z' - 1 >= 0
if(z, z', z'') -{ 1 }→ z'' :|: z' >= 0, z'' >= 0, z = 0
nonZero(z) -{ 1 }→ 1 :|: z - 1 >= 0
nonZero(z) -{ 1 }→ 0 :|: z = 0
p(z) -{ 1 }→ 0 :|: z = 0
p(z) -{ 1 }→ z - 1 :|: z - 1 >= 0
rand(z, z') -{ 13 }→ s' :|: s' >= 0, s' <= 1 * z' + 1 + 1 * 0, z' >= 0, z = 0
rand(z, z') -{ 13 + 5·z }→ s'' :|: s'' >= 0, s'' <= 1 * z' + 1 + 1 * (1 + (z - 1)), z - 1 >= 0, z' >= 0
random(z) -{ 14 + 5·z }→ s :|: s >= 0, s <= 1 * z + 1 * 0 + 1, z >= 0

Function symbols to be analyzed: {p}, {random}
Previous analysis results are:
if: runtime: O(n1) [11 + 5·z'], size: O(n1) [1 + z' + z'']
rand: runtime: O(n1) [13 + 5·z], size: O(n1) [1 + z + z']
nonZero: runtime: O(1) [1], size: O(1) [1]
id_inc: runtime: O(1) [1], size: O(n1) [1 + z]
p: runtime: ?, size: O(n1) [z]

(35) IntTrsBoundProof (UPPER BOUND(ID) transformation)


Computed RUNTIME bound using CoFloCo for: p
after applying outer abstraction to obtain an ITS,
resulting in: O(1) with polynomial bound: 1

(36) Obligation:

Complexity RNTS consisting of the following rules:

id_inc(z) -{ 1 }→ z :|: z >= 0
id_inc(z) -{ 1 }→ 1 + z :|: z >= 0
if(z, z', z'') -{ 16 }→ s1 :|: s1 >= 0, s1 <= 1 * 0 + 1 * z'' + 1, z = 1, z'' >= 0, z' = 0
if(z, z', z'') -{ 16 }→ s2 :|: s2 >= 0, s2 <= 1 * 0 + 1 * (1 + z'') + 1, z = 1, z'' >= 0, z' = 0
if(z, z', z'') -{ 11 + 5·z' }→ s3 :|: s3 >= 0, s3 <= 1 * (z' - 1) + 1 * z'' + 1, z = 1, z'' >= 0, z' - 1 >= 0
if(z, z', z'') -{ 11 + 5·z' }→ s4 :|: s4 >= 0, s4 <= 1 * (z' - 1) + 1 * (1 + z'') + 1, z = 1, z'' >= 0, z' - 1 >= 0
if(z, z', z'') -{ 1 }→ z'' :|: z' >= 0, z'' >= 0, z = 0
nonZero(z) -{ 1 }→ 1 :|: z - 1 >= 0
nonZero(z) -{ 1 }→ 0 :|: z = 0
p(z) -{ 1 }→ 0 :|: z = 0
p(z) -{ 1 }→ z - 1 :|: z - 1 >= 0
rand(z, z') -{ 13 }→ s' :|: s' >= 0, s' <= 1 * z' + 1 + 1 * 0, z' >= 0, z = 0
rand(z, z') -{ 13 + 5·z }→ s'' :|: s'' >= 0, s'' <= 1 * z' + 1 + 1 * (1 + (z - 1)), z - 1 >= 0, z' >= 0
random(z) -{ 14 + 5·z }→ s :|: s >= 0, s <= 1 * z + 1 * 0 + 1, z >= 0

Function symbols to be analyzed: {random}
Previous analysis results are:
if: runtime: O(n1) [11 + 5·z'], size: O(n1) [1 + z' + z'']
rand: runtime: O(n1) [13 + 5·z], size: O(n1) [1 + z + z']
nonZero: runtime: O(1) [1], size: O(1) [1]
id_inc: runtime: O(1) [1], size: O(n1) [1 + z]
p: runtime: O(1) [1], size: O(n1) [z]

(37) ResultPropagationProof (UPPER BOUND(ID) transformation)

Applied inner abstraction using the recently inferred runtime/size bounds where possible.

(38) Obligation:

Complexity RNTS consisting of the following rules:

id_inc(z) -{ 1 }→ z :|: z >= 0
id_inc(z) -{ 1 }→ 1 + z :|: z >= 0
if(z, z', z'') -{ 16 }→ s1 :|: s1 >= 0, s1 <= 1 * 0 + 1 * z'' + 1, z = 1, z'' >= 0, z' = 0
if(z, z', z'') -{ 16 }→ s2 :|: s2 >= 0, s2 <= 1 * 0 + 1 * (1 + z'') + 1, z = 1, z'' >= 0, z' = 0
if(z, z', z'') -{ 11 + 5·z' }→ s3 :|: s3 >= 0, s3 <= 1 * (z' - 1) + 1 * z'' + 1, z = 1, z'' >= 0, z' - 1 >= 0
if(z, z', z'') -{ 11 + 5·z' }→ s4 :|: s4 >= 0, s4 <= 1 * (z' - 1) + 1 * (1 + z'') + 1, z = 1, z'' >= 0, z' - 1 >= 0
if(z, z', z'') -{ 1 }→ z'' :|: z' >= 0, z'' >= 0, z = 0
nonZero(z) -{ 1 }→ 1 :|: z - 1 >= 0
nonZero(z) -{ 1 }→ 0 :|: z = 0
p(z) -{ 1 }→ 0 :|: z = 0
p(z) -{ 1 }→ z - 1 :|: z - 1 >= 0
rand(z, z') -{ 13 }→ s' :|: s' >= 0, s' <= 1 * z' + 1 + 1 * 0, z' >= 0, z = 0
rand(z, z') -{ 13 + 5·z }→ s'' :|: s'' >= 0, s'' <= 1 * z' + 1 + 1 * (1 + (z - 1)), z - 1 >= 0, z' >= 0
random(z) -{ 14 + 5·z }→ s :|: s >= 0, s <= 1 * z + 1 * 0 + 1, z >= 0

Function symbols to be analyzed: {random}
Previous analysis results are:
if: runtime: O(n1) [11 + 5·z'], size: O(n1) [1 + z' + z'']
rand: runtime: O(n1) [13 + 5·z], size: O(n1) [1 + z + z']
nonZero: runtime: O(1) [1], size: O(1) [1]
id_inc: runtime: O(1) [1], size: O(n1) [1 + z]
p: runtime: O(1) [1], size: O(n1) [z]

(39) IntTrsBoundProof (UPPER BOUND(ID) transformation)


Computed SIZE bound using CoFloCo for: random
after applying outer abstraction to obtain an ITS,
resulting in: O(n1) with polynomial bound: 1 + z

(40) Obligation:

Complexity RNTS consisting of the following rules:

id_inc(z) -{ 1 }→ z :|: z >= 0
id_inc(z) -{ 1 }→ 1 + z :|: z >= 0
if(z, z', z'') -{ 16 }→ s1 :|: s1 >= 0, s1 <= 1 * 0 + 1 * z'' + 1, z = 1, z'' >= 0, z' = 0
if(z, z', z'') -{ 16 }→ s2 :|: s2 >= 0, s2 <= 1 * 0 + 1 * (1 + z'') + 1, z = 1, z'' >= 0, z' = 0
if(z, z', z'') -{ 11 + 5·z' }→ s3 :|: s3 >= 0, s3 <= 1 * (z' - 1) + 1 * z'' + 1, z = 1, z'' >= 0, z' - 1 >= 0
if(z, z', z'') -{ 11 + 5·z' }→ s4 :|: s4 >= 0, s4 <= 1 * (z' - 1) + 1 * (1 + z'') + 1, z = 1, z'' >= 0, z' - 1 >= 0
if(z, z', z'') -{ 1 }→ z'' :|: z' >= 0, z'' >= 0, z = 0
nonZero(z) -{ 1 }→ 1 :|: z - 1 >= 0
nonZero(z) -{ 1 }→ 0 :|: z = 0
p(z) -{ 1 }→ 0 :|: z = 0
p(z) -{ 1 }→ z - 1 :|: z - 1 >= 0
rand(z, z') -{ 13 }→ s' :|: s' >= 0, s' <= 1 * z' + 1 + 1 * 0, z' >= 0, z = 0
rand(z, z') -{ 13 + 5·z }→ s'' :|: s'' >= 0, s'' <= 1 * z' + 1 + 1 * (1 + (z - 1)), z - 1 >= 0, z' >= 0
random(z) -{ 14 + 5·z }→ s :|: s >= 0, s <= 1 * z + 1 * 0 + 1, z >= 0

Function symbols to be analyzed: {random}
Previous analysis results are:
if: runtime: O(n1) [11 + 5·z'], size: O(n1) [1 + z' + z'']
rand: runtime: O(n1) [13 + 5·z], size: O(n1) [1 + z + z']
nonZero: runtime: O(1) [1], size: O(1) [1]
id_inc: runtime: O(1) [1], size: O(n1) [1 + z]
p: runtime: O(1) [1], size: O(n1) [z]
random: runtime: ?, size: O(n1) [1 + z]

(41) IntTrsBoundProof (UPPER BOUND(ID) transformation)


Computed RUNTIME bound using CoFloCo for: random
after applying outer abstraction to obtain an ITS,
resulting in: O(n1) with polynomial bound: 14 + 5·z

(42) Obligation:

Complexity RNTS consisting of the following rules:

id_inc(z) -{ 1 }→ z :|: z >= 0
id_inc(z) -{ 1 }→ 1 + z :|: z >= 0
if(z, z', z'') -{ 16 }→ s1 :|: s1 >= 0, s1 <= 1 * 0 + 1 * z'' + 1, z = 1, z'' >= 0, z' = 0
if(z, z', z'') -{ 16 }→ s2 :|: s2 >= 0, s2 <= 1 * 0 + 1 * (1 + z'') + 1, z = 1, z'' >= 0, z' = 0
if(z, z', z'') -{ 11 + 5·z' }→ s3 :|: s3 >= 0, s3 <= 1 * (z' - 1) + 1 * z'' + 1, z = 1, z'' >= 0, z' - 1 >= 0
if(z, z', z'') -{ 11 + 5·z' }→ s4 :|: s4 >= 0, s4 <= 1 * (z' - 1) + 1 * (1 + z'') + 1, z = 1, z'' >= 0, z' - 1 >= 0
if(z, z', z'') -{ 1 }→ z'' :|: z' >= 0, z'' >= 0, z = 0
nonZero(z) -{ 1 }→ 1 :|: z - 1 >= 0
nonZero(z) -{ 1 }→ 0 :|: z = 0
p(z) -{ 1 }→ 0 :|: z = 0
p(z) -{ 1 }→ z - 1 :|: z - 1 >= 0
rand(z, z') -{ 13 }→ s' :|: s' >= 0, s' <= 1 * z' + 1 + 1 * 0, z' >= 0, z = 0
rand(z, z') -{ 13 + 5·z }→ s'' :|: s'' >= 0, s'' <= 1 * z' + 1 + 1 * (1 + (z - 1)), z - 1 >= 0, z' >= 0
random(z) -{ 14 + 5·z }→ s :|: s >= 0, s <= 1 * z + 1 * 0 + 1, z >= 0

Function symbols to be analyzed:
Previous analysis results are:
if: runtime: O(n1) [11 + 5·z'], size: O(n1) [1 + z' + z'']
rand: runtime: O(n1) [13 + 5·z], size: O(n1) [1 + z + z']
nonZero: runtime: O(1) [1], size: O(1) [1]
id_inc: runtime: O(1) [1], size: O(n1) [1 + z]
p: runtime: O(1) [1], size: O(n1) [z]
random: runtime: O(n1) [14 + 5·z], size: O(n1) [1 + z]

(43) FinalProof (EQUIVALENT transformation)

Computed overall runtime complexity

(44) BOUNDS(1, n^1)